#ifndef NOTE
#define NOTE

#ifdef WIN32
#include <Windows.h>
#endif
#include "GL/glew.h"

typedef int NOTEMASK;
#define GREEN (1L << 0)
#define RED (1L << 1)
#define YELLOW (1L << 2)
#define BLUE (1L << 3)
#define ORANGE (1L << 4)

class Objet;
class Shader;

class Note
{
	public:
		Note(double,double,int);
		Note();

		static double SCALE;
		static double ERRORTOL;
		static double TOTALLENGTH;
		static int SOUNDOFFSET;

		static GLuint texId_missed;
		static GLuint texId_ok;
		static GLuint texId_doublestrum;
		static GLuint texId_missed_band;
		static GLuint texId_highlights[5];
		static GLuint texId_standards[5];
		static GLuint texId_nostrums[5];
		static GLuint texId_standard_bands[5];
		static Shader* note_shader;
		static int note_geom;
		static int bande_geom;

		int getTrack() {return m_track;};
		double getTime() {return m_time;};
		double getDuration() {return m_duration;};
		Objet* getNoteObject() {return m_noteObj;};
		Objet* getBandeObject() {return m_bandeObj;};

		void requireStrum(bool b) {m_tostrum = b;};
		void setStrummed(bool b);
		void hammer() {m_hammered=true;};

		void buildNoteObject();
		void buildBandeObject();
		void draw(float songtime);
		void resetObjs();

		void setChord(bool b) {m_chord=b;};
		void setMissed(bool b);
		void setInterrupted(bool b);
		void tagDoubleStrum();

		bool isAlreadyStrummed() { return m_strummed; };
		bool hasBeenHamerred() {return m_hammered;};
		bool isStrumRequired(){return m_tostrum;};
		bool isAChord() {return m_chord;};
		bool getMissed() {return m_missed;};
		bool getInterrupted() {return m_interrupted;};

	private:
		int m_track;
		double m_time;
		double m_duration;
		bool m_tostrum;
		bool m_strummed;
		bool m_hammered;
		bool m_chord;
		bool m_missed;
		bool m_interrupted;

		Objet *m_noteObj;
		Objet *m_bandeObj;
};

#endif
